
package interfaces;

import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.WindowConstants;

public class IVisualizaContato {
	
	private JLabel lnome;
	private JLabel lendereco;
	private JLabel ldataniver;
	private JLabel lformacontato;
	private JLabel ldescricao;
	private JPanel pane;
	private JPanel paneaux;
	private JLabel nextline;
	private JButton voltar;
	private JFrame jvc;
	
	public IVisualizaContato(String nome,String endereco,String dataniver,String formacontato,String descricao){
		jvc = new JFrame("Detalhes sobre " + nome);
		jvc.setSize(250,400);
		
        FlowLayout layoutl = new FlowLayout(FlowLayout.LEFT);
        FlowLayout layoutc = new FlowLayout(FlowLayout.CENTER);
		
		pane = new JPanel(layoutl);
		paneaux = new JPanel(layoutc);
		
		//labels
		lnome = new JLabel("Nome:  " + nome);
		lendereco = new JLabel("Endereco:  " + endereco);
		ldataniver = new JLabel("Data de Aniversario:  " + dataniver);
		lformacontato = new JLabel("Forma de contato:  " + formacontato);
		ldescricao = new JLabel("Descricao:  " + descricao);
		nextline = new JLabel("                          ");
		
		//butao
		voltar  = new JButton("Voltar");
		voltar.setBounds(300, 1, 10, 10);
		voltar.setHorizontalTextPosition(SwingConstants.CENTER);
		voltar.setVerticalAlignment(SwingConstants.TOP);
		voltar.setVerticalTextPosition(SwingConstants.BOTTOM);
		voltar.setIcon(new
				ImageIcon("src/images/back.png"));
		voltar.setBackground(Color.WHITE);
		voltar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				jvc.dispose();
			}
		});
		
		pane.add(nextline);
		pane.add(lnome);
		pane.add(nextline);
		pane.add(lendereco);
		pane.add(nextline);
		pane.add(ldataniver);
		pane.add(nextline);
		pane.add(lformacontato);
		pane.add(ldescricao);
		pane.add(voltar);

        jvc.setContentPane(pane);
        jvc.setResizable(false);
        jvc.setVisible(true);
	}
}
